The present invention relates to translation lookaside buffers and, more specifically, to incorporating purge history into least-recently-used states of a translation lookaside buffer.
A translation lookaside buffer (TLB) is a memory cache that stores recent translations between virtual memory and physical memory, to reduce access time to physical memory. The TLB can reside between a central processing unit (CPU) and CPU cache, between caches, or between the CPU cache and main memory, for example. When a virtual address is to be translated, the TLB is checked to determine whether a translation is already stored. If a translation for the virtual address is found in the TLB, this is referred to as a hit. If no translation is found in the TLB, this is a miss, and the translation then requires checking page tables to determine the corresponding physical address to the virtual address.
Some computer systems can include multiple levels of TLBs, and in that case, the various levels may vary in size, such that a smaller TLB may allow faster access to stored translations. For instance, some systems include a TLB2, which is a second-level TLB in addition to a smaller TLB. In some cases, a TLB2 includes multiple compartments, each of which includes multiple page table entry (PTE) sets. Each PTE set represents a translation from a virtual page to a physical page.
Generally, a TLB uses a replacement policy to determine which entry is replaced when the TLB is full and a new translation needs to be inserted into the TLB. For example, a common replacement policy dictates replacing data in the least-recently-used PTE set with the new translation.